﻿using Iworld.Administrator.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Iworld.Administrator.Service.Export
{
    /// <summary>
    /// 管理员组
    /// </summary>
    [DataContract]
    public class AdministratorGroupExport
    {
        [DataMember]
        public int Id { set; get; }

        /// <summary>
        /// 名称
        /// </summary>
        [DataMember]
        public string Name { set; get; }

        /// <summary>
        /// 能否编辑牌局
        /// </summary>
         [DataMember]
        public bool CanEditGameRound { set; get; }

         /// <summary>
         /// 能否查看牌局信息
         /// </summary>
         [DataMember]
         public bool CanViewGameRound { set; get; }

         /// <summary>
         /// 是否能查看牌轮信息
         /// </summary>
         [DataMember]
         public bool CanViewGameChapter { set; get; }

        /// <summary>
        /// 能否编辑前台用户
         /// </summary>
         [DataMember]
        public bool CanEditUser { set; get; }

        /// <summary>
        /// 能否编辑游戏设置
         /// </summary>
         [DataMember]
        public bool CanEditGameSetting { set; get; }

        /// <summary>
        /// 能否生成充值卡
         /// </summary>
         [DataMember]
        public bool CanCreateRechargeCard { set; get; }

        /// <summary>
        /// 能否编辑管理员
         /// </summary>
         [DataMember]
        public bool CanEditAdministrator { set; get; }

        /// <summary>
        /// 能否编辑管理员用户组
         /// </summary>
        [DataMember]
        public bool CanEditAdministratorGroup { set; get; }

        /// <summary>
        /// 是否处理提现
        /// </summary>
       [DataMember]
        public bool CanReviewWithdrawals { set; get; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DataMember]
        public DateTime CreatedTime { set; get; }

        [DataMember]
        public bool CanEdited { set; get; }


        public AdministratorGroupExport(AdministratorGroup group)
        {
            this.Id = group.Id;
            this.Name = group.Name;
            this.CanEditGameRound = group.CanEditGameRound;
            this.CanEditUser = group.CanEditUser;
            this.CanEditGameSetting = group.CanEditGameSetting;
            this.CanCreateRechargeCard = group.CanCreateRechargeCard;
            this.CanEditAdministrator = group.CanEditAdministrator;
            this.CanViewGameChapter = group.CanViewGameChapter;
            this.CanViewGameRound = group.CanViewGameRound;
            this.CreatedTime = group.CreatedTime;
            this.CanEditAdministratorGroup = group.CanEditAdministratorGroup;
            this.CanEdited = SuperAcountInfoPackage.Username != group.Name;
            this.CanReviewWithdrawals = group.CanReviewWithdrawals;
        }
    }
}
